package org.csmzxy.class2334;

public class shuixianhuashu {
    public static boolean
    isShuiXianHuaShu(int num){
        if (num>=100 && num<=999){
            int hundreds = num / 100;
            int tens = (num / 10) % 10;
            int units = num % 10;
            return num == (hundreds*hundreds*hundreds+tens*tens*tens+units*units*units);
        }
        return false;
    }

    public static void main(String[] args){
        int testNum = 113 ;
        boolean result = isShuiXianHuaShu(testNum);
        System.out.println(testNum + "是否为水仙花数:"+ result );
    }
}
